<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>绑定style样式</title>
  <script src="../../js/vue.js"></script>
  <style>
    .basic{
      width: 400px;
      height: 100px;
      border: 1px solid black;
    }
  </style>


</head>
<body>
<div id="root">
  <!-- 绑定style样式--数组写法 -->
  <div class="basic" :style="styleArr">{{name}}</div>
</div>

<script>
  Vue.config.productionTip = false

  const vm = new Vue({
    el:'#root',

    data:{
      name:'曾宇杰',

      styleArr:[
        {
          fontSize: '40px',
          color:'blue',
        },
        {
          backgroundColor:'gray'
        }
      ]
    },
  })
</script>


</body>
</html>